import os

# base path
base_path = "/home/vick/demos/reward"
# server path
server_path = base_path + "/server-py/app.py"
# celery path
celery_path = "celery_tasks"
# web path
web_path = base_path + "/web/build"
# log path
log_path = "/home/vick/demos/reward/server-py/log"

# 启动后端
server_main = f"nohup python {server_path} > {log_path}/server.log 2>&1 &"
# 启动celery
celery_main = f"nohup celery -A {celery_path} worker -l info > {log_path}/celery_server.log 2>&1 &"
# 启动web
web_main = f"nohup serve -s {web_path} > {log_path}/web.log 2>&1 &"

# linux 启动
os.system(server_main)
os.system(celery_main)
os.system(web_main)

print("start success")
